Skip to content

Conversation

@Jadeiin
Copy link

@Jadeiin Jadeiin commented Nov 5, 2025

Description

Since the latest update in isaaclab.sh breaks installation with uv, I modified ensure_cuda_torch to maintain compatiability with uv installation method. Tested on my machine and it works

Fixes #3524

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Screenshots

Please attach before and after screenshots of the change if applicable.

Checklist

  • I have read and understood the contribution guidelines
  • I have run the pre-commit checks with ./isaaclab.sh --format
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • I have updated the changelog and the corresponding version in the extension's config/extension.toml file
  • I have added my name to the CONTRIBUTORS.md or my name already exists there

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Greptile Overview

Greptile Summary

This PR refactors the ensure_cuda_torch function in isaaclab.sh to fix a compatibility issue with UV package manager installations. The changes replace direct parameter passing and hardcoded pip commands with calls to existing helper functions (extract_python_exe(), extract_pip_command(), extract_pip_uninstall_command()) that properly detect and use the appropriate commands for different environments (conda, UV, system python). The version checking logic is also improved by using direct Python imports instead of pip version queries, making it more reliable across different package managers. The contributor has also added their name to the CONTRIBUTORS.md file following project guidelines.

Important Files Changed

Filename Score Overview
isaaclab.sh 4/5 Refactored ensure_cuda_torch function to use helper functions for UV compatibility and improved version checking
CONTRIBUTORS.md 5/5 Added new contributor "Zijian Li" to the alphabetically sorted list

Confidence score: 4/5

  • This PR addresses a legitimate bug that breaks UV installations and uses well-established helper functions already present in the codebase
  • Score reflects solid implementation using existing patterns, though the checklist indicates missing documentation updates and tests for the fix
  • Pay close attention to isaaclab.sh to ensure the refactored function works correctly across all supported environments (conda, UV, system python)

Sequence Diagram

sequenceDiagram
    participant User
    participant Script as "isaaclab.sh"
    participant System as "System Commands"
    participant Python as "Python/Pip"
    participant UV as "UV Package Manager"

    User->>Script: "./isaaclab.sh --install"
    Script->>Script: "install_system_deps()"
    Script->>System: "Check if cmake installed"
    System-->>Script: "Status response"
    
    alt cmake not installed
        Script->>System: "sudo apt-get install cmake build-essential"
    end
    
    Script->>Script: "extract_python_exe()"
    Script->>Script: "extract_pip_command()"
    Script->>Script: "extract_pip_uninstall_command()"
    
    alt ARM architecture detected
        Script->>Script: "begin_arm_install_sandbox()"
        Script->>Script: "Unset LD_PRELOAD temporarily"
    end
    
    Script->>Script: "ensure_cuda_torch()"
    
    alt UV environment detected
        Script->>UV: "uv pip uninstall torch torchvision torchaudio"
        UV-->>Script: "Uninstall response"
        Script->>UV: "uv pip install torch torchvision"
        UV-->>Script: "Install response"
    else Standard pip environment
        Script->>Python: "python -m pip uninstall torch torchvision torchaudio"
        Python-->>Script: "Uninstall response"
        Script->>Python: "python -m pip install torch torchvision"
        Python-->>Script: "Install response"
    end
    
    Script->>Script: "Install isaaclab extensions"
    Script->>Python: "Install source directory extensions"
    Python-->>Script: "Extension install responses"
    
    Script->>Python: "Install RL frameworks"
    Python-->>Script: "Framework install response"
    
    Script->>Script: "ensure_cuda_torch() (verification)"
    
    alt ARM architecture
        Script->>Script: "end_arm_install_sandbox()"
        Script->>Script: "Restore LD_PRELOAD"
    end
    
    alt Not in Docker
        Script->>Script: "update_vscode_settings()"
        Script->>Python: "Run setup_vscode.py"
        Python-->>Script: "VSCode setup response"
    end
    
    Script-->>User: "Installation complete"
Loading

2 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

mettz added a commit to mettz/isaaclab that referenced this pull request Nov 6, 2025
@kellyguo11 kellyguo11 moved this to In review in Isaac Lab Nov 7, 2025
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Greptile Overview

Greptile Summary

This PR refactors the ensure_cuda_torch function in isaaclab.sh to fix UV package manager compatibility issues. The changes replace hardcoded pip commands with standardized helper functions that automatically detect the environment type and use appropriate commands (uv pip for UV environments, pip for standard environments). The refactoring removes the python executable parameter from the function and adds a new extract_pip_uninstall_command() helper function. Additionally, the contributor Zijian Li has been added to the CONTRIBUTORS.md file following the project's alphabetical ordering guidelines.

Important Files Changed

Filename Score Overview
CONTRIBUTORS.md 5/5 Adds new contributor "Zijian Li" to the alphabetical list
isaaclab.sh 4/5 Refactors ensure_cuda_torch function to use extracted commands and adds extract_pip_uninstall_command() helper

Confidence score: 4/5

  • This PR is relatively safe to merge with low risk of breaking existing functionality
  • Score reflects well-structured changes that follow established patterns, but deducted one point due to changes in critical installation logic that could affect multiple package managers and the lack of comprehensive testing coverage mentioned in the checklist
  • Pay close attention to the isaaclab.sh file, particularly the refactored ensure_cuda_torch function and new extract_pip_uninstall_command() helper

2 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: In review

Development

Successfully merging this pull request may close these issues.

[Bug Report] Cannot install IsaacLab with uv

3 participants